<?php
namespace app\common\api\controller;
use think\Controller;
use think\Db;
class Login extends Controller{
    public function Index(){
        $content = file_get_contents('php://input');
        parse_str($content,$arr);

        $result = Db::name('user_relation')->where('user_num',$arr['username'])->find();

        if (!$result){
            return '';
        }
            $result['password'] = $result['password1'];
            $result['user_id']  = $result['user_num'];
            $result['nickname'] = $result['user_num'];
            $result['user_money'] = $result['money1'];
            $result['frozen_money'] = 0;
            $result['is_distribut'] = 0;
            $result['distribut_money'] =0;
            $result['pay_points'] =0;
            $result['mobile_validated'] = 1;
            $result['email_validated'] = 0;
            $result['is_lock'] = 2;
            $result['level']   = 1;
        return json_encode($result);
    }
}